<#import "../home/masterTemplate.ftl" as layout />
<#include "../macros/utils.ftl" />
<#import "../macros/spring.ftl" as spring />

<#----><#include "/dumps/dump-util.ftl" />

<#assign scriptsObj>
	<#if isMobile()>

	<#else>
		require(["../js/modules/form", "../js/exams/exams"], function() {
	</#if>
		base.init();
		base.exams.init();

	<#if !isMobile()>
		});
	</#if>
</#assign>

<#assign user = m_site.m_user />

<@layout.masterTemplate wtSection="" wtSubsection="" title="" bodycss="" wrappercss="bg" section="home" subsection="" pagename="" color="" sectionIdx="1">

	<@backHeader "Add" "Exams" /> 
	<div class="col1-of-2">
		<div class="frm comment-form cf" id="addExam" data-async="true" data-type="add">
			<div class="content"></div>
			<form action="<@spring.url '/exams/add_input/' />" method="POST">
			  
			  <div class="form-group visible inline-block">
			    <label for="email" class="control-label input-group">please, select an user:</label>
			  	<select class="form-control users selectpicker" data-live-search="true" name="email" id="user" title="email" required="required">
			       <#if getList(m_site.m_usersList)?size gt 0>
			    	   <#list getList(m_site.m_usersList) as user>
			            <option value="${user.email}" >${user.lastName+", "+user.firstName} </option>
			         </#list>
			       </#if>
			  	</select>
			  </div><br>
			  
			  <div class="form-group visible  inline-block">
			    <label for="pro_id" class="control-label input-group">which profile are you looking for?:</label>
			  	<select class="form-control profiles selectpicker" data-live-search="true" name="pro_id" id="profile" title="Topic" required="required">
			       <#if getList(m_site.m_profilesList)?size gt 0>
			    	   <#list getList(m_site.m_profilesList) as profile>
			    	   	<#if profile.topicsList?size gt 0>
			            	<option value="${profile.id}" >${profile.id} &#9656; ${profile.title} </option>
			    	   	</#if>
			         </#list>
			       </#if>
			  	</select>
			  	<p class="alert alert-info"><strong>Note</strong>: in order to assign a profile to an exam, It must be linked with at least one topic.</p>
			  </div><br>

			  <div class="form-group  inline-block">
			  	<label for="count">how many questions?:</label>
			  	<input type="number" class="form-control" id="count" name="count" title="size"  maxlength="3" required="required" data-rules="number,maxlength:3" />
			  </div><br>

			  <div class="cf confirm"><a class="btn btn-primary submit right" role="button">submit</a></div>
			</form>
		</div>
	</div>
	<div class="col2-of-2">
		
	</div>
	<#----><@dumper m_site "m_site" false true/>
</@layout.masterTemplate>